<?php

class Ext_Attachment_Video_Show
{
    public $videoId;
    public $attachmentVideoId;
    public $video;
    public $title;
    public $description;
    public $descriptionHtmlOn;
    
    public function __construct($attachmentVideoId)
    {
        $this->video = new Ext_Video_Show();
        $this->_build($attachmentVideoId);
    }
    
    private function _build($attachmentVideoId)
    {
        $this->attachmentVideoId = $attachmentVideoId;

        $attachmentVideo = App_Model_DbTable_Attachment_Video::getInstance()->getRowById($attachmentVideoId);

        if(isset($attachmentVideo['videoId'])){
            $this->videoId = $attachmentVideo['videoId'];
            $this->video->build($this->videoId);
        }

        if(isset($attachmentVideo['title'])){
            $this->title = $attachmentVideo['title'];
        }
        
        if(isset($attachmentVideo['description'])){
            $this->description       = $attachmentVideo['description'];
            $this->descriptionHtmlOn = $attachmentVideo['descriptionHtmlOn'];
        }
    }
}


